// src/components/Navbar/UserInfo/UserInfoItem.js
import strUserInfoItemHtml from "./UserInfoItem.html";
import { DomUtils } from "../../../utils/DomUtils";

export class UserInfoItem {
  constructor(userInfo) {
    this.userInfo = userInfo;
  }

  render() {
    let strHtml = strUserInfoItemHtml;

    strHtml = strHtml.replace("{{name}}", this.userInfo.name);
    strHtml = strHtml.replace("{{role}}", this.userInfo.role);
    strHtml = strHtml.replace("{{createAt}}", this.userInfo.createAt);
    strHtml = strHtml.replace("{{email}}", this.userInfo.email);
    strHtml = strHtml.replace("{{id}}", this.userInfo.id);
    return DomUtils.convertToDom(strHtml);
  }
}
